/***********************************************************************
 * Module:  Kho.cs
 * Author:  Tuan Nguyen
 * Purpose: Definition of the Class Kho
 ***********************************************************************/

using System;

public class Kho
{
   public int MaKho;
   public string TenKho;
   public string DiaChiNv;
   public string DienThoaiKh;
   
   public System.Collections.ArrayList khoThanhPham;
   
   /// <pdGenerated>default getter</pdGenerated>
   public System.Collections.ArrayList GetKhoThanhPham()
   {
      if (khoThanhPham == null)
         khoThanhPham = new System.Collections.ArrayList();
      return khoThanhPham;
   }
   
   /// <pdGenerated>default setter</pdGenerated>
   public void SetKhoThanhPham(System.Collections.ArrayList newKhoThanhPham)
   {
      RemoveAllKhoThanhPham();
      foreach (KhoThanhPham oKhoThanhPham in newKhoThanhPham)
         AddKhoThanhPham(oKhoThanhPham);
   }
   
   /// <pdGenerated>default Add</pdGenerated>
   public void AddKhoThanhPham(KhoThanhPham newKhoThanhPham)
   {
      if (newKhoThanhPham == null)
         return;
      if (this.khoThanhPham == null)
         this.khoThanhPham = new System.Collections.ArrayList();
      if (!this.khoThanhPham.Contains(newKhoThanhPham))
      {
         this.khoThanhPham.Add(newKhoThanhPham);
         newKhoThanhPham.SetKho(this);      
      }
   }
   
   /// <pdGenerated>default Remove</pdGenerated>
   public void RemoveKhoThanhPham(KhoThanhPham oldKhoThanhPham)
   {
      if (oldKhoThanhPham == null)
         return;
      if (this.khoThanhPham != null)
         if (this.khoThanhPham.Contains(oldKhoThanhPham))
         {
            this.khoThanhPham.Remove(oldKhoThanhPham);
            oldKhoThanhPham.SetKho((Kho)null);
         }
   }
   
   /// <pdGenerated>default removeAll</pdGenerated>
   public void RemoveAllKhoThanhPham()
   {
      if (khoThanhPham != null)
      {
         System.Collections.ArrayList tmpKhoThanhPham = new System.Collections.ArrayList();
         foreach (KhoThanhPham oldKhoThanhPham in khoThanhPham)
            tmpKhoThanhPham.Add(oldKhoThanhPham);
         khoThanhPham.Clear();
         foreach (KhoThanhPham oldKhoThanhPham in tmpKhoThanhPham)
            oldKhoThanhPham.SetKho((Kho)null);
         tmpKhoThanhPham.Clear();
      }
   }
   public System.Collections.ArrayList khoSanPhamDoDang;
   
   /// <pdGenerated>default getter</pdGenerated>
   public System.Collections.ArrayList GetKhoSanPhamDoDang()
   {
      if (khoSanPhamDoDang == null)
         khoSanPhamDoDang = new System.Collections.ArrayList();
      return khoSanPhamDoDang;
   }
   
   /// <pdGenerated>default setter</pdGenerated>
   public void SetKhoSanPhamDoDang(System.Collections.ArrayList newKhoSanPhamDoDang)
   {
      RemoveAllKhoSanPhamDoDang();
      foreach (KhoSanPhamDoDang oKhoSanPhamDoDang in newKhoSanPhamDoDang)
         AddKhoSanPhamDoDang(oKhoSanPhamDoDang);
   }
   
   /// <pdGenerated>default Add</pdGenerated>
   public void AddKhoSanPhamDoDang(KhoSanPhamDoDang newKhoSanPhamDoDang)
   {
      if (newKhoSanPhamDoDang == null)
         return;
      if (this.khoSanPhamDoDang == null)
         this.khoSanPhamDoDang = new System.Collections.ArrayList();
      if (!this.khoSanPhamDoDang.Contains(newKhoSanPhamDoDang))
      {
         this.khoSanPhamDoDang.Add(newKhoSanPhamDoDang);
         newKhoSanPhamDoDang.SetKho(this);      
      }
   }
   
   /// <pdGenerated>default Remove</pdGenerated>
   public void RemoveKhoSanPhamDoDang(KhoSanPhamDoDang oldKhoSanPhamDoDang)
   {
      if (oldKhoSanPhamDoDang == null)
         return;
      if (this.khoSanPhamDoDang != null)
         if (this.khoSanPhamDoDang.Contains(oldKhoSanPhamDoDang))
         {
            this.khoSanPhamDoDang.Remove(oldKhoSanPhamDoDang);
            oldKhoSanPhamDoDang.SetKho((Kho)null);
         }
   }
   
   /// <pdGenerated>default removeAll</pdGenerated>
   public void RemoveAllKhoSanPhamDoDang()
   {
      if (khoSanPhamDoDang != null)
      {
         System.Collections.ArrayList tmpKhoSanPhamDoDang = new System.Collections.ArrayList();
         foreach (KhoSanPhamDoDang oldKhoSanPhamDoDang in khoSanPhamDoDang)
            tmpKhoSanPhamDoDang.Add(oldKhoSanPhamDoDang);
         khoSanPhamDoDang.Clear();
         foreach (KhoSanPhamDoDang oldKhoSanPhamDoDang in tmpKhoSanPhamDoDang)
            oldKhoSanPhamDoDang.SetKho((Kho)null);
         tmpKhoSanPhamDoDang.Clear();
      }
   }
   public System.Collections.ArrayList khoNguyenLieu;
   
   /// <pdGenerated>default getter</pdGenerated>
   public System.Collections.ArrayList GetKhoNguyenLieu()
   {
      if (khoNguyenLieu == null)
         khoNguyenLieu = new System.Collections.ArrayList();
      return khoNguyenLieu;
   }
   
   /// <pdGenerated>default setter</pdGenerated>
   public void SetKhoNguyenLieu(System.Collections.ArrayList newKhoNguyenLieu)
   {
      RemoveAllKhoNguyenLieu();
      foreach (KhoNguyenLieu oKhoNguyenLieu in newKhoNguyenLieu)
         AddKhoNguyenLieu(oKhoNguyenLieu);
   }
   
   /// <pdGenerated>default Add</pdGenerated>
   public void AddKhoNguyenLieu(KhoNguyenLieu newKhoNguyenLieu)
   {
      if (newKhoNguyenLieu == null)
         return;
      if (this.khoNguyenLieu == null)
         this.khoNguyenLieu = new System.Collections.ArrayList();
      if (!this.khoNguyenLieu.Contains(newKhoNguyenLieu))
      {
         this.khoNguyenLieu.Add(newKhoNguyenLieu);
         newKhoNguyenLieu.SetKho(this);      
      }
   }
   
   /// <pdGenerated>default Remove</pdGenerated>
   public void RemoveKhoNguyenLieu(KhoNguyenLieu oldKhoNguyenLieu)
   {
      if (oldKhoNguyenLieu == null)
         return;
      if (this.khoNguyenLieu != null)
         if (this.khoNguyenLieu.Contains(oldKhoNguyenLieu))
         {
            this.khoNguyenLieu.Remove(oldKhoNguyenLieu);
            oldKhoNguyenLieu.SetKho((Kho)null);
         }
   }
   
   /// <pdGenerated>default removeAll</pdGenerated>
   public void RemoveAllKhoNguyenLieu()
   {
      if (khoNguyenLieu != null)
      {
         System.Collections.ArrayList tmpKhoNguyenLieu = new System.Collections.ArrayList();
         foreach (KhoNguyenLieu oldKhoNguyenLieu in khoNguyenLieu)
            tmpKhoNguyenLieu.Add(oldKhoNguyenLieu);
         khoNguyenLieu.Clear();
         foreach (KhoNguyenLieu oldKhoNguyenLieu in tmpKhoNguyenLieu)
            oldKhoNguyenLieu.SetKho((Kho)null);
         tmpKhoNguyenLieu.Clear();
      }
   }

}